package org.bulkLoader.comply
{
	public class BulkFile implements IBulkFile
	{
		private var _fileType:String;
		private var _fileUrl:String;
		private var _ownParameter:Object;
		
		public function BulkFile(url:String, parameter:Object)
		{
			_fileUrl = url;
			_ownParameter = parameter;
			
			_fileType = getFileType();
		}
		
		private function getFileType():String
		{
			if (_ownParameter.hasOwnProperty(BulkLoaderDefine.ITEM_MINETYPE))
			{
				if (BulkLoaderDefine.hasSupportFileType(_ownParameter[BulkLoaderDefine.ITEM_MINETYPE]))
					return _ownParameter[BulkLoaderDefine.ITEM_MINETYPE];
				else
					return BulkLoaderDefine.FILE_BINARY;
			}
			else
			{
				return BulkLoaderDefine.getFileTypeByUrl(_fileUrl);
			}
		}
		
		public function get type():String
		{
			return _fileType;
		}
		
		public function get url():String
		{
			return _fileUrl;
		}
		
		public function get ownParameter():Object
		{
			return _ownParameter;
		}
	}
}